home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / commands / dd.c.D < prev    next >
Text File  |  1990-07-25  |  1KB  |  77 lines

  1. *** /tmp/,RCSt1022131    Wed Jul 25 13:41:05 1990
  2. --- dd.c    Mon Jul 23 16:37:52 1990
  3. ***************
  4. *** 1,4 ****
  5. ! #include "stdio.h"
  6. ! #include "signal.h"
  7.   
  8.   #define EOS '\0'
  9. --- 1,9 ----
  10. ! /* dd - disk dumper */
  11.   
  12. + #include <sys/types.h>
  13. + #include <signal.h>
  14. + #include <fcntl.h>
  15. + #include <unistd.h>
  16. + #include <stdio.h>
  17.   #define EOS '\0'
  18. ***************
  19. *** 71,73 ****
  20.   int flag = 0;
  21. ! int cnull(), ibm(), null(), over();
  22.   int ifd, ofd, ibc;
  23. --- 76,79 ----
  24.   int flag = 0;
  25. ! int cnull(), ibm(), null();
  26. ! void over();
  27.   int ifd, ofd, ibc;
  28. ***************
  29. *** 104,110 ****
  30.   
  31. - over()
  32. - {
  33. -   statistics();
  34. -   exit(0);
  35. - }
  36.   
  37. --- 110,111 ----
  38. ***************
  39. *** 209,211 ****
  40.       convert = cnull;
  41. !   if ((ifd = ((ifilename) ? open(ifilename, 0) : dup(0))) < 0) {
  42.       fprintf(stderr, "dd: cannot open %s\n",
  43. --- 210,212 ----
  44.       convert = cnull;
  45. !   if ((ifd = ((ifilename) ? open(ifilename, O_RDONLY) : dup(0))) < 0) {
  46.       fprintf(stderr, "dd: cannot open %s\n",
  47. ***************
  48. *** 247,249 ****
  49.     for (; nseek; nseek--)
  50. !     lseek(ofd, (long) obs, 1);
  51.   outputall:
  52. --- 248,250 ----
  53.     for (; nseek; nseek--)
  54. !     lseek(ofd, (long) obs, SEEK_CUR);
  55.   outputall:
  56. ***************
  57. *** 266,268 ****
  58.               if (ibuf[i] != 0)
  59. !                 ibs = i;
  60.           statistics();
  61. --- 267,269 ----
  62.               if (ibuf[i] != 0)
  63. !                 ibc = i;
  64.           statistics();
  65. ***************
  66. *** 338,339 ****
  67. --- 339,346 ----
  68.     }
  69. + }
  70. + void over()
  71. + {
  72. +   statistics();
  73. +   exit(0);
  74.   }
  75.